[java] Trying to use ResourceBundle to fetch messages from external file

Posted by bumperbox on Stack Overflow See other posts from Stack Overflow or by bumperbox
Published on 2010-04-05T21:24:36Z Indexed on 2010/04/05 21:33 UTC
Read the original article Hit count: 340

Filed under:
|

Essentially I would like to have a messages.properties files external to the jar files in my application. So that users can add languages and edit the files easily if my translations are wrong

at the moment i use

ResourceBundle.getBundle("package.MessageBundle");

But i would like to do something like this

ResourceBundle.getBundle("lang/MessageBundle");

Where lang is a folder under my application installation directory.

  1. is this a good idea (if not, why not)?
  2. can someone point me in the right direction, or some sample code that does this

thanks

Alex

© Stack Overflow or respective owner

Related posts about java

Related posts about internationalization